﻿package coreFx{
	import flash.display.MovieClip;
	import flash.display.Stage;
	import flash.events.Event;
	import flash.display.Sprite;
    import flash.text.*;
	
	public class StateFinish extends MovieClip{
		
		//Attrib
		var InQueue:Array;
		var margin:Number;
		
		
		var passCount:Number;
		public var txQueue:TextField;
		//public var txPass:TextField;
		var format:TextFormat;
		
		
		
		
		
		
		public function StateFinish(parentStage:Stage){
			
			trace("StateFinish Engage");
			InQueue = new Array();
			margin = -6;
			this.x = 0;
			this.y = parentStage.height + 20;
			
			
			passCount=0;
			txQueue = new TextField();
			//txPass = new TextField();			
			//parentStage.addChild(txQueue);
			//parentStage.addChild(txPass);
			
			txQueue.text = "0 In Queue";
			txQueue.x = this.x-160;
			txQueue.y = this.y+50;
			txQueue.width = 200;
			
			/*txPass.text = "0 has Passed";
			txPass.x = this.x-160;
			txPass.y = this.y+70;
			txPass.width = 200;*/
			
			format = new TextFormat();
			format.size = 26;
			txQueue.setTextFormat(format);
			//txPass.setTextFormat(format);
			
			
			
			
		}
		
		
		
		public function _push(cus:Customer){
			//play service MC
			//cus.y = this.y;
			//cus.x = this.x;

			InQueue.push(cus);trace('>>>> push to stateFinish')
			txQueue.text = InQueue.length+" In Queue";
			txQueue.setTextFormat(format);
			//stop service MC 
		}		
		
	}
}